<?php echo $this->fetch('header.html'); ?>
<script type="text/javascript">
$(function(){
    $('#add_time_from').datepicker({dateFormat: 'yy-mm-dd',changeMonth: true, changeYear: true});
    $('#add_time_to').datepicker({dateFormat: 'yy-mm-dd',changeMonth: true, changeYear: true});
});

</script>
<div id="rightTop">
  <ul class="subnav">
    <?php $_from = $this->_var['_dh_banner']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'subitem');if (count($_from)):
    foreach ($_from AS $this->_var['subitem']):
?>
        <?php if ($this->_var['subitem']['name'] == $this->_var['_curitem']): ?>
            <li><a href="<?php echo $this->_var['subitem']['url']; ?>" class="btn0"><?php echo $this->_var['subitem']['text']; ?></a>
        <?php else: ?>
            <li><a href="<?php echo $this->_var['subitem']['url']; ?>" class="btn1"><?php echo $this->_var['subitem']['text']; ?></a>
        <?php endif; ?>
    <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>  
  </ul>
</div>

<div class="mrightTop">
  <div class="fontl">
    <form method="get">
       <div class="left">
         <input type="hidden" name="app" value="caiwu" />
          <input type="hidden" name="act" value="money_list" />
    <select name="type" onchange="location='index.php?app=caiwu&act=money_list&type='+this.value+'<?php if ($_GET['add_time_from']): ?>&add_time_from=<?php echo $_GET['add_time_from']; ?><?php endif; ?><?php if ($_GET['add_time_to']): ?>&add_time_to=<?php echo $_GET['add_time_to']; ?><?php endif; ?>';">
      <option value="" <?php if (! $_GET['type']): ?>selected<?php endif; ?>>收支类型</option>
      <option value="10" <?php if ($_GET['type'] == 10): ?>selected<?php endif; ?>>订单收入</option>
      <option value="20" <?php if ($_GET['type'] == 20): ?>selected<?php endif; ?>>订单支出</option>
      <option value="30" <?php if ($_GET['type'] == 30): ?>selected<?php endif; ?>>网上充值</option>
      <option value="40" <?php if ($_GET['type'] == 40): ?>selected<?php endif; ?>>银行充值</option>
      <option value="50" <?php if ($_GET['type'] == 50): ?>selected<?php endif; ?>>帐户转入</option>
      <option value="51" <?php if ($_GET['type'] == 51): ?>selected<?php endif; ?>>帐户支出</option>
    </select>
     <select name="caozuo">
      <option value="" <?php if (! $_GET['caozuo']): ?>selected<?php endif; ?>>支付状态</option>
      <option value="1" <?php if ($_GET['caozuo'] == '1'): ?>selected<?php endif; ?>>-支付成功-</option>
      <option value="0" <?php if ($_GET['caozuo'] == '0'): ?>selected<?php endif; ?>>-等待支付-</option>
    </select>    
      <select name="field_name">
      <option value="user_name" <?php if ($_GET['field_name'] == 'user_name'): ?>selected<?php endif; ?>>会员名</option>
      <option value="pay_order_sn" <?php if ($_GET['field_name'] == 'pay_order_sn'): ?>selected<?php endif; ?>>支付单号</option>
      <option value="user_id" <?php if ($_GET['field_name'] == 'user_id'): ?>selected<?php endif; ?>>会员ID号</option>
      <option value="log_text" <?php if ($_GET['field_name'] == 'log_text'): ?>selected<?php endif; ?>>备注</option>
      <option value="id" <?php if ($_GET['field_name'] == 'id'): ?>selected<?php endif; ?>>帐务ID号</option>
      </select>
      <input type="text" name="field_value" value="<?php echo htmlspecialchars($_GET['field_value']); ?>" />    
    起止日期：<input type="text" name="add_time_from" id="add_time_from" value="<?php echo $_GET['add_time_from']; ?>" style="width:80px;"/> &#8211;
    <input type="text" class="width5" name="add_time_to" id="add_time_to" value="<?php echo $_GET['add_time_to']; ?>" style="width:80px;"/>
   

           <select name="pagenum">
            <option value="20" <?php if ($this->_var['pagenum'] == 20): ?>selected<?php endif; ?>>每页20条</option>
            <option value="50" <?php if ($this->_var['pagenum'] == 50): ?>selected<?php endif; ?>>每页50条</option>
            <option value="100" <?php if ($this->_var['pagenum'] == 100): ?>selected<?php endif; ?>>每页100条</option>
            <option value="150" <?php if ($this->_var['pagenum'] == 150): ?>selected<?php endif; ?>>每页150条</option>
            <option value="200" <?php if ($this->_var['pagenum'] == 200): ?>selected<?php endif; ?>>每页200条</option>
          </select>
          <input type="submit" class="formbtn" value="查询" />
      </div>
      <?php if ($this->_var['filtered']): ?>
      <a class="left formbtn1" href="index.php?app=user">撤销检索</a>
      <?php endif; ?>
    </form>
  </div>
  <div class="fontr"><?php echo $this->fetch('page.top.html'); ?></div>
</div>
<div class="tdare">
         
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="dataTable">
  <tr class="tatr1">
    <td>ID</td>
    <td>会员</td>
    <td>时间</td>
    <td class="table-center">收入</td>
    <td class="table-center">支出</td>
    <td class="table-center">余额</td>
    <td class="table-center">收支类型</td>
    <td class="table-center">支付宝单号/订单号</td>
    <td class="table-center">状态</td>
    <td class="table-center">支付渠道</td>
    <td class="table-center">支付帐号(银行)</td>
    <td width="300">备注</td>
  </tr>
  <?php $_from = $this->_var['my_money']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'mymoney');if (count($_from)):
    foreach ($_from AS $this->_var['mymoney']):
?>
  <tr class="tatr2">
    <td><?php echo $this->_var['mymoney']['id']; ?></td>
    <td><a href='index.php?app=caiwu&act=money_list&field_name=user_name&field_value=<?php echo urlencode($this->_var['mymoney']['user_name']); ?>' title="点击查看该用户的所有帐务记录"><?php echo $this->_var['mymoney']['user_name']; ?></a>
    <a href="index.php?app=caiwu&user_id=<?php echo $this->_var['mymoney']['user_id']; ?>" target="_blank" style="color:#999">管理</a>
    <a href="index.php?app=caiwu&amp;act=userinfo&amp;user_id=<?php echo $this->_var['mymoney']['user_id']; ?>" target="_blank" style="color:#999">资料</a></td>
    <td><?php echo local_date("Y-m-d H:i:s",$this->_var['mymoney']['add_time']); ?></td>
    <td class="table-center"><strong <?php if ($this->_var['mymoney']['money_sr'] > 0): ?>class=bhong<?php endif; ?>><?php echo ($this->_var['mymoney']['money_sr'] == '') ? '-' : $this->_var['mymoney']['money_sr']; ?></strong></td>
    <td class="table-center"><strong <?php if ($this->_var['mymoney']['money_zc'] > 0): ?>class=bhong<?php endif; ?>><?php echo ($this->_var['mymoney']['money_zc'] == '') ? '-' : $this->_var['mymoney']['money_zc']; ?></strong></td>
    <td class="table-center"><strong <?php if ($this->_var['mymoney']['money_yue'] > 0): ?>class=bhong<?php endif; ?>><?php echo ($this->_var['mymoney']['money_yue'] == '') ? '-' : $this->_var['mymoney']['money_yue']; ?></strong></td>
    <td class="table-center">
    <?php if ($this->_var['mymoney']['leixing'] == 10): ?>订单收入
    <?php elseif ($this->_var['mymoney']['leixing'] == 20): ?>订单支出
    <?php elseif ($this->_var['mymoney']['leixing'] == 30): ?>网上充值
    <?php elseif ($this->_var['mymoney']['leixing'] == 40): ?>银行充值
    <?php elseif ($this->_var['mymoney']['leixing'] == 50): ?>帐户转入
    <?php elseif ($this->_var['mymoney']['leixing'] == 51): ?>帐户支出
    <?php endif; ?></td>
    <td class="table-center" style="font-size:11px; line-height:85%"><?php echo $this->_var['mymoney']['pay_order_sn']; ?><br /><font style="color:#999"><?php echo $this->_var['mymoney']['pay_which_order']; ?></font></td>
    <td class="table-center"><?php if ($this->_var['mymoney']['caozuo'] == 1): ?><font color="#009900">支付成功</font><?php else: ?>等待支付<?php endif; ?></td>
    <td class="table-center"><?php echo $this->_var['mymoney']['bank_name_check']; ?></td>
    <td class="table-center"><?php echo $this->_var['mymoney']['bank_account']; ?></td>
    <td style="width:320px;word-wrap:break-word;word-break:break-all;"><?php if ($this->_var['mymoney']['admin_time']): ?><font color="#FF0000">管理员操作</font><?php endif; ?><?php echo $this->_var['mymoney']['log_text']; ?></td>
  </tr>
  <?php endforeach; else: ?>
  <tr class="no_data">
      <td colspan="12"><br />暂无账户收支明细<br /></td>
  </tr>
  <?php endif; unset($_from); ?><?php $this->pop_vars();; ?>
</table>
<div style="margin-top:8px; overflow:hidden; width:100%">
<div class="left">
<?php if ($this->_var['money_total']['money_sr_total']): ?>收入总计：<strong style="color:#F00"><?php echo $this->_var['money_total']['money_sr_total']; ?></strong> <?php endif; ?>&nbsp;&nbsp;&nbsp;&nbsp;
<?php if ($this->_var['money_total']['money_zc_total']): ?>支出总计：<strong style="color:#F00"><?php echo $this->_var['money_total']['money_zc_total']; ?></strong> <?php endif; ?>
</div>
<div class="right">
<?php echo $this->fetch('page.bottom.html'); ?>
</div>
</div>
</div>
<?php echo $this->fetch('footer.html'); ?>